package com.ebpm.designer.pvm
{
	
	import com.ebpm.designer.mainLayout.variable.Variable;
	
	import flash.events.MouseEvent;
	
	import mx.containers.Canvas;
	
	import spark.components.Group;
	import spark.primitives.BitmapImage;
	import com.ebpm.designer.NodeContainer;
	import com.ebpm.designer.WF;
	
	public class ForkAfter extends UserTask
	{
		public function ForkAfter(nodeContainer:NodeContainer)
		{
			super(nodeContainer);
		}
		
		override public function initStyle():void 
		{
			this.width = WF.START_EVENT_W;
			this.height = WF.START_EVENT_W;
			this.nodeContainer.width = this.width + WF.ITEM_SIZE * 2;
			this.nodeContainer.height = this.height + WF.ITEM_SIZE * 2;
			
			this.initIcon();
		}
		
		override public function initIcon():void {
			var titleIcon:Canvas = new Canvas();
			titleIcon.x = 0;
			titleIcon.y = 0;
			titleIcon.width = this.width;
			titleIcon.height = this.height;
			
			var group:Group = new Group();
			var bi:BitmapImage = new BitmapImage();
			bi.source = WF.Icon_ForkGatherEvent;
			bi.x = 0;
			bi.y = 0;
			bi.width = titleIcon.width;
			bi.height = titleIcon.height;
			group.addElement(bi);
			titleIcon.addElement(group);
			this.addElement(titleIcon);
		}
		
//		override public function _mouseOut(event:MouseEvent):void {}
		
		override public function toggleDiaplayDirs():void {}
		
		override public function _mouseUp(event:MouseEvent):void
		{
			//判断是否是item的连线事件			
			drawLineWithItem();
			//判断是否是ctrl的连线事件			
			drawLineWithCtrl();
		}
		
		override public function _mouseOver(event:MouseEvent):void
		{
			WF.wp.hideNodeContainerItems();
			this.nodeContainer.displayItems();
		}
		
		override public function displayVariablePanel():void {
			WF.wp.forkBeforeVariablePanel.showMe();
			WF.wp.forkBeforeVariablePanel.vc.clearContent();
			WF.wp.forkBeforeVariablePanel.vc.initContent(this.nodeContainer.variable);
		}
		
		
	}
}